<!DOCTYPE html>
<html>
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <title>$.fn.contents</title>
        <script>
            window.$$path = location.protocol + "//" + location.host;
            document.write('<script src="' + $$path + '/mass_merge.js"><\/script>')
            document.write('<script src="' + $$path + '/doc/scripts/common.js"><\/script>')
        </script>
    </head>
    
    <body>
        <article>
            <h3>$.fn.contents( )</h3>
            <p>
                <span class="stress">描述：</span>
            </p>
            <p>取得匹配元素的所有节点，去重排序组成新mass实例返回。</p>
            <p>此方法与children方法相似，但它比后者能获取更多的节点，如文本节点，注释节点。如果是一个iframe元素则取得其对应的文档对象。</p>
            <p>
                <span class="stress">返回值：</span>
            </p>
            <p>新mass实例。</p>
            <fieldset>
                <legend>例子</legend>
                <ul class="sample1">
                    <li>list item 1</li>
                    <li>list item 2
                        <ul>
                            <li>list item 2-a</li>
                            <li>list item 2-b</li>
                        </ul>
                    </li>
                    <li>
                        <b>list item 3</b>
                    </li>
                    <li>list item 4</li>
                </ul>
                <pre class="brush:xml;gutter:false;toolbar:false">

    <ul class="sample1">
        <li>list item 1</li>
        <li>list item 2
            <ul>
                <li>list item 2-a</li>
                <li>list item 2-b</li>
            </ul>
        </li>
        <li><b>list item 3</b></li>
        <li>list item 4</li>
    </ul>
    
</pre>
                <pre class="brush:javascript;gutter:false;toolbar:false">
$.require("ready,node", function() {
    $.log($(".sample1").children().length, true);
    $.log($(".sample1").contents().length, true);
});
</pre>
                <button class="doc_btn" type="button">点我，执行代码</button>
            </fieldset>
        </article>
    </body>

</html>